# Maintainer: Gennady Feldman <gena01@gmail.com>
# Contributor: Gennady Feldman <gena01@gmail.com>
pkgname=py3-fastavro
_pkgname=fastavro
pkgver=0.23.4
pkgrel=0
pkgdesc="Fast Avro for Python"
# Tests for optional zstd and snappy codecs require
# unpackaged python modules 'zstandard' and 'python-snappy'
options="!check"
url="https://github.com/fastavro/fastavro"
arch="all !x86 !mips !mips64" # _tz_ tests fail, blocked by numpy on mips
license="MIT"
depends="py3-six"
makedepends="py3-setuptools python3-dev cython"
checkdepends="py3-pytest py3-numpy"
source="$pkgname-$pkgver.tar.gz::https://github.com/fastavro/fastavro/archive/$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

build() {
	FASTAVRO_USE_CYTHON=1 python3 setup.py build
}

check() {
	PYTHONPATH="$(echo $PWD/build/lib.*)" python3 -m pytest -v tests
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
}

sha512sums="3afa3a5cf47089271ea3bbef029cf9fea60bf8d9fc8d2f7835c7bc08433d01f53f9e4b6db2e69950bd61875798ef05e604f2caa4e9001eb451be2a048c178acc  py3-fastavro-0.23.4.tar.gz"
